package com.example.demo.config;

import com.lagou.rpc.api.IUserService;
import com.lagou.rpc.consumer.proxy.RpcClientProxy;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.context.annotation.Bean;

@SpringBootConfiguration
public class RpcConfig {

    @Bean
    public IUserService getUserService(){
        IUserService userService = (IUserService) RpcClientProxy.createProxy(IUserService.class);
        return userService;
    }
}
